options: tag: &f[&eEnchant&f] on load: clear {egui::version} set {egui::version} to yaml value "version" from file "EnchGUI/config.yml" if {egui::version} is not set: set yaml value "version" from file "EnchGUI/config.yml" to "1.0" set yaml value "values.lvl1.block" from file "EnchGUI/config.yml" to "0" set yaml value "values.lvl2.block" from file "EnchGUI/config.yml" to "11" set yaml value "values.lvl3.block" from file "EnchGUI/config.yml" to "22" set yaml value "values.lvl1.lvl-min" from file "EnchGUI/config.yml" to "7" set yaml value "values.lvl2.lvl-min" from file "EnchGUI/config.yml" to "15" set yaml value "values.lvl3.lvl-min" from file "EnchGUI/config.yml" to "25" set yaml value "values.lvl1.lvl-max" from file "EnchGUI/config.yml" to "14" set yaml value "values.lvl2.lvl-max" from file "EnchGUI/config.yml" to "24" set yaml value "values.lvl3.lvl-max" from file "EnchGUI/config.yml" to "30" add "sword" to yaml list "items" from file "EnchGUI/config.yml" add "axe" to yaml list "items" from file "EnchGUI/config.yml" add "smite" to yaml list "enchants.sword" from file "EnchGUI/config.yml" set yaml value "enchants.lvl1.smite" from file "EnchGUI/enchants.yml" to "1,2" set {egui::value.lvl1.block} to single value "values.lvl1.block" get of "plugins/Skript/scripts/EnchGUI/config.yml" parsed as number set {egui::value.lvl2.block} to single value "values.lvl2.block" get of "plugins/Skript/scripts/EnchGUI/config.yml" parsed as number set {egui::value.lvl3.block} to single value "values.lvl3.block" get of "plugins/Skript/scripts/EnchGUI/config.yml" parsed as number set {egui::value.lvl1.lvl-min} to single value "values.lvl1.lvl-min" get of "plugins/Skript/scripts/EnchGUI/config.yml" parsed as number set {egui::value.lvl2.lvl-min} to single value "values.lvl2.lvl-min" get of "plugins/Skript/scripts/EnchGUI/config.yml" parsed as number set {egui::value.lvl3.lvl-min} to single value "values.lvl3.lvl-min" get of "plugins/Skript/scripts/EnchGUI/config.yml" parsed as number set {egui::value.lvl1.lvl-max} to single value "values.lvl1.lvl-max" get of "plugins/Skript/scripts/EnchGUI/config.yml" parsed as number set {egui::value.lvl2.lvl-max} to single value "values.lvl2.lvl-max" get of "plugins/Skript/scripts/EnchGUI/config.yml" parsed as number set {egui::value.lvl3.lvl-max} to single value "values.lvl3.lvl-max" get of "plugins/Skript/scripts/EnchGUI/config.yml" parsed as number clear {egui::items::*} set {egui::items::*} to value list "items" get of "plugins/Skript/scripts/EnchGUI/config.yml" loop {egui::items::*}: set {egui::enchants::items::%loop-value%::enchant::*} to value list "enchants.%loop-value%" get of "plugins/Skript/scripts/EnchGUI/config.yml" set {egui::enchants::items::%loop-value%::amount} to 0 loop {egui::enchants::items::%loop-value%::enchant::*}: add 1 to {egui::enchants::items::%loop-value-1%::amount} set {egui::enchants::items::%loop-value-1%::enchant-amount::%{egui::enchants::items::%loop-value-1%::amount}%} to loop-value-2 on rightclick on enchantment table: if player has permission "egui.user" or "egui.vip": cancel event if player's tool is enchanted book: send "{@tag} Ten item jest juz zaklety!" stop if player's tool is enchanted: send "{@tag} Ten item jest juz zaklety!" stop else: loop {egui::items::*}: if "%player's tool%" contains "%loop-value%": set {egui::items::%player%::enchant-item} to loop-value set {_egui::items::%player%::enchant-item::start} to true exit loop if {_egui::items::%player%::enchant-item::start} is true: if {_egui::items::%player%::enchant-item::start} is true: set {_egui::bookshelf::%player%} to 0 loop all blocks in radius 7 of player: if loop-block is bookshelf: add 1 to {_egui::bookshelf::%player%} if {_egui::bookshelf::%player%} >= {egui::value.lvl1.block}: if {egui::enchants::items::%{egui::items::%player%::enchant-item}%::amount} = 1: set {_egui::enchants::enchant::%player%} to {egui::enchants::items::%{egui::items::%player%::enchant-item}%::enchant-amount::%{egui::enchants::items::%{egui::items::%player%::enchant-item}%::amount}%} else: set {_egui::enchants::enchant::%player%} to random integer from 0 to {egui::enchants::items::%{egui::items::%player%::enchant-item}%::amount} set {_egui::enchants::enchant::%player%} to {egui::enchants::items::%{egui::items::%player%::enchant-item}%::enchant-amount::%{_egui::enchants::enchant::%player%}%} set {_egui::enchants::enchant::%player%::lvl1} to yaml value "enchants.lvl1.%{_egui::enchants::enchant::%player%}%" from file "EnchGUI/enchants.yml" if {_egui::enchants::enchant::%player%::lvl1} is set: if {_egui::enchants::enchant::%player%::lvl1} contains ",": set {_enchant-lvl::all-lvl::%player%} to 0 loop 5 times: if "%{_egui::enchants::enchant::%player%::lvl1}%" contains "%loop-number%": add 1 to {_enchant-lvl::all-lvl::%player%} set {_enchant-lvl::lvl-%{_enchant-lvl::all-lvl::%player%}%::%player%} to loop-number if {_enchant-lvl::all-lvl::%player%} > 1: set {_enchant-lvl::all-lvl::%player%} to random integer from 0 to {_enchant-lvl::all-lvl::%player%} if {_enchant-lvl::all-lvl::%player%} <= 0: loop 5 times: if "%{_egui::enchants::enchant::%player%::lvl1}%" contains "%loop-number%": set {_enchant-lvl::all-lvl::%player%} to loop-number exit loop replace all "_" with " " in {_egui::enchants::enchant::%player%} set {_egui::enchant::lvl1::%player%} to "%{_egui::enchants::enchant::%player%}% %{_enchant-lvl::lvl-%{_enchant-lvl::all-lvl::%player%}%::%player%}%" else: if {_enchant-lvl::all-lvl::%player%} = 1: replace all "_" with " " in {_egui::enchants::enchant::%player%} set {_egui::enchant::lvl1::%player%} to "%{_egui::enchants::enchant::%player%}% %{_enchant-lvl::lvl-%{_enchant-lvl::all-lvl::%player%}%::%player%}%" else: stop else: replace all "_" with " " in {_egui::enchants::enchant::%player%} set {_egui::enchant::lvl1::%player%} to "%{_egui::enchants::enchant::%player%}% %{_egui::enchants::enchant::%player%::lvl1}%" else: stop set {_egui::lvl1::%player%} to random integer from {egui::value.lvl1.lvl-min} to {egui::value.lvl1.lvl-max} set {_egui::lvl2::%player%} to {_egui::lvl1::%player%} set {_egui::lvl3::%player%} to {_egui::lvl1::%player%} set {_egui::enchant::lvl2::%player%} to {_egui::enchant::lvl1::%player%} parsed as enchantment type set {_egui::enchant::lvl3::%player%} to {_egui::enchant::lvl1::%player%} parsed as enchantment type set {_egui::enchant::lvl1::%player%} to {_egui::enchant::lvl1::%player%} parsed as enchantment type if {_egui::bookshelf::%player%} >= {egui::value.lvl2.block}: if {egui::enchants::items::%{egui::items::%player%::enchant-item}%::amount} = 1: set {_egui::enchants::enchant::%player%} to {egui::enchants::items::%{egui::items::%player%::enchant-item}%::enchant-amount::%{egui::enchants::items::%{egui::items::%player%::enchant-item}%::amount}%} else: set {_egui::enchants::enchant::%player%} to random integer from 0 to {egui::enchants::items::%{egui::items::%player%::enchant-item}%::amount} set {_egui::enchants::enchant::%player%} to {egui::enchants::items::%{egui::items::%player%::enchant-item}%::enchant-amount::%{_egui::enchants::enchant::%player%}%} set {_egui::enchants::enchant::%player%::lvl2} to yaml value "enchants.lvl2.%{_egui::enchants::enchant::%player%}%" from file "EnchGUI/enchants.yml" if {_egui::enchants::enchant::%player%::lvl2} is set: if {_egui::enchants::enchant::%player%::lvl2} contains ",": set {_enchant-lvl::all-lvl::%player%} to 0 loop 5 times: if "%{_egui::enchants::enchant::%player%::lvl2}%" contains "%loop-number%": add 1 to {_enchant-lvl::all-lvl::%player%} set {_enchant-lvl::lvl-%{_enchant-lvl::all-lvl::%player%}%::%player%} to loop-number if {_enchant-lvl::all-lvl::%player%} > 1: set {_enchant-lvl::all-lvl::%player%} to random integer from 1 to {_enchant-lvl::all-lvl::%player%} if {_enchant-lvl::all-lvl::%player%} <= 0: loop 5 times: if "%{_egui::enchants::enchant::%player%::lvl2}%" contains "%loop-number%": set {_enchant-lvl::all-lvl::%player%} to loop-number exit loop replace all "_" with " " in {_egui::enchants::enchant::%player%} set {_egui::enchant::lvl2::%player%} to "%{_egui::enchants::enchant::%player%}% %{_enchant-lvl::lvl-%{_enchant-lvl::all-lvl::%player%}%::%player%}%" else: if {_enchant-lvl::all-lvl::%player%} = 1: replace all "_" with " " in {_egui::enchants::enchant::%player%} set {_egui::enchant::lvl2::%player%} to "%{_egui::enchants::enchant::%player%}% %{_enchant-lvl::lvl-%{_enchant-lvl::all-lvl::%player%}%::%player%}%" else: stop else: replace all "_" with " " in {_egui::enchants::enchant::%player%} set {_egui::enchant::lvl2::%player%} to "%{_egui::enchants::enchant::%player%}% %{_egui::enchants::enchant::%player%::lvl2}%" else: stop set {_egui::lvl2::%player%} to random integer from {egui::value.lvl2.lvl-min} to {egui::value.lvl2.lvl-max} set {_egui::lvl3::%player%} to {_egui::lvl2::%player%} set {_egui::enchant::lvl3::%player%} to {_egui::enchant::lvl2::%player%} parsed as enchantment type set {_egui::enchant::lvl2::%player%} to {_egui::enchant::lvl2::%player%} parsed as enchantment type if {_egui::bookshelf::%player%} >= {egui::value.lvl3.block}: if {egui::enchants::items::%{egui::items::%player%::enchant-item}%::amount} = 1: set {_egui::enchants::enchant::%player%} to {egui::enchants::items::%{egui::items::%player%::enchant-item}%::enchant-amount::%{egui::enchants::items::%{egui::items::%player%::enchant-item}%::amount}%} else: set {_egui::enchants::enchant::%player%} to random integer from 0 to {egui::enchants::items::%{egui::items::%player%::enchant-item}%::amount} set {_egui::enchants::enchant::%player%} to {egui::enchants::items::%{egui::items::%player%::enchant-item}%::enchant-amount::%{_egui::enchants::enchant::%player%}%} set {_egui::enchants::enchant::%player%::lvl3} to yaml value "enchants.lvl3.%{_egui::enchants::enchant::%player%}%" from file "EnchGUI/enchants.yml" if {_egui::enchants::enchant::%player%::lvl3} is set: if {_egui::enchants::enchant::%player%::lvl3} contains ",": set {_enchant-lvl::all-lvl::%player%} to 0 loop 5 times: if "%{_egui::enchants::enchant::%player%::lvl3}%" contains "%loop-number%": add 1 to {_enchant-lvl::all-lvl::%player%} set {_enchant-lvl::lvl-%{_enchant-lvl::all-lvl::%player%}%::%player%} to loop-number if {_enchant-lvl::all-lvl::%player%} > 1: set {_enchant-lvl::all-lvl::%player%} to random integer from 0 to {_enchant-lvl::all-lvl::%player%} if {_enchant-lvl::all-lvl::%player%} <= 0: loop 5 times: if "%{_egui::enchants::enchant::%player%::lvl3}%" contains "%loop-number%": set {_enchant-lvl::all-lvl::%player%} to loop-number exit loop replace all "_" with " " in {_egui::enchants::enchant::%player%} set {_egui::enchant::lvl3::%player%} to "%{_egui::enchants::enchant::%player%}% %{_enchant-lvl::lvl-%{_enchant-lvl::all-lvl::%player%}%::%player%}%" else: if {_enchant-lvl::all-lvl::%player%} = 1: replace all "_" with " " in {_egui::enchants::enchant::%player%} set {_egui::enchant::lvl3::%player%} to "%{_egui::enchants::enchant::%player%}% %{_enchant-lvl::lvl-%{_enchant-lvl::all-lvl::%player%}%::%player%}%" else: stop else: replace all "_" with " " in {_egui::enchants::enchant::%player%} set {_egui::enchant::lvl3::%player%} to "%{_egui::enchants::enchant::%player%}% %{_egui::enchants::enchant::%player%::lvl3}%" else: stop set {_egui::lvl3::%player%} to random integer from {egui::value.lvl3.lvl-min} to {egui::value.lvl3.lvl-max} set {_egui::enchant::lvl3::%player%} to {_egui::enchant::lvl3::%player%} parsed as enchantment type set {_egui::%player%::command::item} to "%player's tool%" replace all " " with "_" in {_egui::%player%::command::item} wait 1 tick open chest with 3 rows named "Enchant" to player wait 1 tick if {_egui::bookshelf::%player%} >= {egui::value.lvl3.block}: loop 11 times: format slot loop-number -1 of player with 1 of bookshelf named "" with lore "" to close then run [execute player command "/enchanting"] format slot 11 of player with 1 of player's tool named "&7Ulepsz item na: &f[&1%{_egui::enchant::lvl1::%player%}%&f]" with lore "&fKoszt ulepszenia: &7[&a%{_egui::lvl1::%player%}%&7] &fLvL" to close then run [execute console command "enchanting %player% %{_egui::%player%::command::item}% %{_egui::lvl1::%player%}% %{_egui::enchant::lvl1::%player%}%"] format slot 12 of player with 1 of bookshelf named "" with lore "" to close then run [execute player command "/enchanting"] format slot 13 of player with 1 of player's tool named "&7Ulepsz item na: &f[&1%{_egui::enchant::lvl2::%player%}%&f]" with lore "&fKoszt ulepszenia: &7[&a%{_egui::lvl2::%player%}%&7] &fLvL" to close then run [execute console command "enchanting %player% %{_egui::%player%::command::item}% %{_egui::lvl2::%player%}% %{_egui::enchant::lvl2::%player%}%"] format slot 14 of player with 1 of bookshelf named "" with lore "" to close then run [execute player command "/enchanting"] format slot 15 of player with 1 of player's tool named "&7Ulepsz item na: &f[&1%{_egui::enchant::lvl3::%player%}%&f]" with lore "&fKoszt ulepszenia: &7[&a%{_egui::lvl3::%player%}%&7] &fLvL" to close then run [execute console command "enchanting %player% %{_egui::%player%::command::item}% %{_egui::lvl3::%player%}% %{_egui::enchant::lvl3::%player%}%"] loop 11 times: format slot loop-number +15 of player with 1 of bookshelf named "" with lore "" to close then run [execute player command "/enchanting"] stop if {_egui::bookshelf::%player%} >= {egui::value.lvl2.block}: loop 12 times: format slot loop-number -1 of player with 1 of bookshelf named "" with lore "" to close then run [execute player command "/enchanting"] format slot 12 of player with 1 of player's tool named "&7Ulepsz item na: &f[&1%{_egui::enchant::lvl1::%player%}%&f]" with lore "&fKoszt ulepszenia: &7[&a%{_egui::lvl1::%player%}%&7] &fLvL" to close then run [execute console command "enchanting %player% %{_egui::%player%::command::item}% %{_egui::lvl1::%player%}% %{_egui::enchant::lvl1::%player%}%"] format slot 13 of player with 1 of bookshelf named "" with lore "" to close then run [execute player command "/enchanting"] format slot 14 of player with 1 of player's tool named "&7Ulepsz item na: &f[&1%{_egui::enchant::lvl2::%player%}%&f]" with lore "&fKoszt ulepszenia: &7[&a%{_egui::lvl2::%player%}%&7] &fLvL" to close then run [execute console command "enchanting %player% %{_egui::%player%::command::item}% %{_egui::lvl2::%player%}% %{_egui::enchant::lvl2::%player%}%"] loop 12 times: format slot loop-number +14 of player with 1 of bookshelf named "" with lore "" to close then run [execute player command "/enchanting"] stop if {_egui::bookshelf::%player%} >= {egui::value.lvl1.block}: loop 13 times: format slot loop-number -1 of player with 1 of bookshelf named "" with lore "" to close then run [execute player command "/enchanting"] format slot 13 of player with 1 of player's tool named "&7Ulepsz item na: &f[&1%{_egui::enchant::lvl1::%player%}%&f]" with lore "&fKoszt ulepszenia: &7[&a%{_egui::lvl1::%player%}%&7] &fLvL" to close then run [execute console command "enchanting %player% %{_egui::%player%::command::item}% %{_egui::lvl1::%player%}% %{_egui::enchant::lvl1::%player%}%"] loop 13 times: format slot loop-number +13 of player with 1 of bookshelf named "" with lore "" to close then run [execute player command "/enchanting"] stop else: send "{@tag} Nie mozna zaklac tego itemu!" stop command /enchanting [] [] [] []: trigger: if player or console has permission "egui.admin": if arg 1 is set: set {_egui::%player%::%arg 1%::item} to "%arg 2%" set {_egui::%player%::%arg 1%::lvl} to "%arg 3%" parsed as number set {_egui::%player%::%arg 1%::enchant} to "%arg 4%" parsed as enchantment type replace all "_" with " " in {_egui::%player%::%arg 1%::item} if "%{_egui::%player%::%arg 1%::item}%" is "%player-arg's tool%": if player-arg's level >= {_egui::%player%::%arg 1%::lvl}: if "%{_egui::%player%::%arg 1%::item}%" contains "book": set {_egui::%player%::%arg 1%::enchant-it} to " 1 enchanted book of %{_egui::%player%::%arg 1%::enchant}%" parsed as item give {_egui::%player%::%arg 1%::enchant-it} to the player-arg remove 1 book from the player-arg send "{@tag} Zaklales przedmiot!" to player-arg else: enchant player-arg's tool with {_egui::%player%::%arg 1%::enchant} set player-arg's level to player-arg's level -{_egui::%player%::%arg 1%::lvl} send "{@tag} Zaklales przedmiot!" to player-arg else: send "{@tag} Masz zbyt maly lvl!" to player-arg stop else: send "{@tag} Nie mozna zaklac tego itemu!" to player-arg stop