#AuctionHouse by PanAnimek #Wersja 1.0 on load: if dir "plugins/Aukcje" doesn't exist: create dir "plugins/Aukcje" create dir "plugins/Aukcje/database" create file "plugins/Aukcje/messages.yml" create file "plugins/Aukcje/config.yml" set yaml value "Autor" from file "plugins/Aukcje/config.yml" to "NexonDEV" set yaml value "Wersja" from file "plugins/Aukcje/config.yml" to "1.0" set yaml value "prefix" from file "plugins/Aukcje/config.yml" to "&7[&aAukcje&7]" set yaml value "min-cena" from file "plugins/Aukcje/config.yml" to 1 set yaml value "max-cena" from file "plugins/Aukcje/config.yml" to 100000 set yaml value "gui.aukcje.nazwa" from file "plugins/Aukcje/messages.yml" to "Dom Aukcyjny" set yaml value "gui.aukcje.dalej" from file "plugins/Aukcje/messages.yml" to "&9Dalej" set yaml value "gui.aukcje.wstecz" from file "plugins/Aukcje/messages.yml" to "&9Wstecz" set yaml value "gui.aukcje.zamknij" from file "plugins/Aukcje/messages.yml" to "&cZamknij" set yaml value "gui.aukcje.item" from file "plugins/Aukcje/messages.yml" to "&a{item}" set yaml value "gui.potwierdz.name" from file "plugins/Aukcje/messages.yml" to "Potwierdz zakup" set yaml value "gui.potwierdz.tak" from file "plugins/Aukcje/messages.yml" to "&a&lKup" set yaml value "gui.potwierdz.nie" from file "plugins/Aukcje/messages.yml" to "&c&lAnuluj" set {ah.prefix} to yaml value "prefix" from file "plugins/Aukcje/config.yml" set {ah.minprice} to yaml value "min-cena" from file "plugins/Aukcje/config.yml" set {ah.maxprice} to yaml value "max-cena" from file "plugins/Aukcje/config.yml" set {msg.ahname} to yaml value "gui.aukcje.nazwa" from file "plugins/Aukcje/messages.yml" set {msg.ahnext} to yaml value "gui.aukcje.dalej" from file "plugins/Aukcje/messages.yml" set {msg.ahprev} to yaml value "gui.aukcje.wstecz" from file "plugins/Aukcje/messages.yml" set {msg.ahclose} to yaml value "gui.aukcje.zamknij" from file "plugins/Aukcje/messages.yml" set {msg.ahitem} to yaml value "gui.aukcje.item" from file "plugins/Aukcje/messages.yml" set {msg.ahpname} to yaml value "gui.potwierdz.nazwa" from file "plugins/Aukcje/messages.yml" set {msg.ahptak} to yaml value "gui.potwierdz.tak" from file "plugins/Aukcje/messages.yml" set {msg.ahpnie} to yaml value "gui.potwierdz.nie" from file "plugins/Aukcje/messages.yml" command /Aukcje:wystaw []: aliases: wystaw trigger: set {_cena} to arg 1 parsed as integer if {_cena} is not set: send "%{ah.prefix}% &cPoprawne uzycie: &7/wystaw " stop if {_cena} < {ah.minprice}: send "%{ah.prefix}% &cMinimalna cena to &7%{ah.minprice}%$" stop if {_cena} > {ah.maxprice}: send "%{ah.prefix}% &cMaksymalna cena to &7%{ah.maxprice}%$" stop set {_czas} to now add 3 days to {_czas} set {_x} to 1 while {_y} is not set: if file "plugins/Aukcje/database/item%{_x}%.yml" doesn't exist: set {_y} to "plugins/Aukcje/database/item%{_x}%.yml" add 1 to {_x} create file {_y} set {_name} to name of player's tool if {_name} is not set: set {_name} to "%type of player's tool%" set yaml value "gracz" from file {_y} to "%player%" set yaml value "item" from file {_y} to "%type of player's tool%" set yaml value "ilosc" from file {_y} to "%item amount of player's tool%" set yaml value "nazwa" from file {_y} to "%{_name}%" set yaml value "czas" from file {_y} to "%{_czas}%" set yaml value "cena" from file {_y} to {_cena} send "%{ah.prefix}% &aPrzedmiot pomyslnie wystawiony!" remove player's tool from player's inventory command /Aukcje:aukcje []: aliases: ah, aukcje trigger: open virtual chest with 6 rows named "%{msg.ahname}%" to player if arg 1 is not set: set {_p1} to 0 set {_p2} to 44 set {_str} to 0 else: set {_p1} to (arg 1 * 45) -1 set {_p2} to {_p1} + 45 set {_str} to arg 1 set {_x} to 0 loop dir "plugins\Aukcje\database"'s files: set {_czas} to yaml value "czas" from file loop-value set {_czas} to {_czas} parsed as date if now is less than {_czas}: if {_x} >= {_p1}: if {_x} <= {_p2}: set {_item} to yaml value "item" from file loop-value set {_item} to {_item} parsed as item set {_ilosc} to yaml value "ilosc" from file loop-value set {_ilosc} to {_ilosc} parsed as number set {_nazwa} to yaml value "nazwa" from file loop-value set {_cena} to yaml value "cena" from file loop-value set {_gracz} to yaml value "gracz" from file loop-value set {_name} to {msg.ahitem} replace all "{item}" in {_name} with "%{_nazwa}%" format gui slot {_x} of player with {_ilosc} of {_item} named {_name} with lore "&aWystawil: &7%{_gracz}%", "&aCena: &7%{_cena}%", "&aKoniec: &7%{_czas}%" to close then run player command "/aukcje:kupitem %{_x} + 1%" with permission "*" add 1 to {_x} set {_maxstr} to {_x} / 45 set {_maxstr} to rounded up {_maxstr} if {_str} > 0: format gui slot 48 of player with 1 arrow named "%{msg.ahprev}%" to run player command "/aukcje:aukcje %{_str} - 1%" else: format gui slot 48 of player with 1 arrow named "%{msg.ahprev}%" format gui slot 49 of player with 1 enchanted book named "&7Strona: &c%{_str} + 1%/%{_maxstr}%" if ({_str} + 1) < {_maxstr}: format gui slot 50 of player with 1 arrow named "%{msg.ahnext}%" to run player command "/aukcje:aukcje %{_str} + 1%" else: format gui slot 50 of player with 1 arrow named "%{msg.ahnext}%" command /Aukcje:kupitem []: permission: aukcje.niedawajgraczomtejpermisji trigger: set {_f} to "plugins/Aukcje/database/item%arg 1%.yml" set {_cena} to yaml value "cena" from file {_f} set {_cena} to {_cena} parsed as integer set {_gracz} to yaml value "gracz" from file {_f} set {_gracz} to {_gracz} parsed as offlineplayer set {_ilosc} to yaml value "ilosc" from file {_f} set {_ilosc} to {_ilosc} parsed as integer set {_item} to yaml value "item" from file {_f} set {_item} to {_item} parsed as item set {_nazwa} to yaml value "nazwa" from file {_f} if player's balance >= {_cena}: add {_ilosc} of {_item} named "%{_nazwa}%" to player's inventory remove {_cena} from player's balance add {_cena} to balance of {_gracz} delete file {_f} send "%{ah.prefix}% &aZakupiono przedmiot!" if {_gracz} is online: send "%{ah.prefix}% &aKtos zakupil twoj przedmiot!" to {_gracz} else: send "%{ah.prefix}% &cMasz zbyt malo pieniedzy!" command /Aukcje:przedawnione []: aliases: przedawnione trigger: open virtual chest with 3 rows named "%{msg.ahname}% &r(Przedawnione)" to player set {_x} to 0 loop dir "plugins\Aukcje\database"'s files: set {_czas} to yaml value "czas" from file loop-value set {_czas} to {_czas} parsed as date set {_gracz} to yaml value "gracz" from file loop-value if {_gracz} is "%player%": if now is less than {_czas}: if {_x} > 26: stop set {_item} to yaml value "item" from file loop-value set {_item} to {_item} parsed as item set {_ilosc} to yaml value "ilosc" from file loop-value set {_ilosc} to {_ilosc} parsed as number set {_nazwa} to yaml value "nazwa" from file loop-value if {_nazwa} is not set: set {_nazwa} to {_item} set {_name} to {msg.ahitem} replace all "{item}" in {_name} with "%{_nazwa}%" format gui slot {_x} of player with {_ilosc} of {_item} named "%{_name}%" to close then run player command "/aukcje:przedawnionyitem %{_x} + 1%" with permission "*" add 1 to {_x} command /Aukcje:przedawnionyitem []: permission: aukcje.niedawajgraczomtejpermisji trigger: set {_f} to "plugins/Aukcje/database/item%arg 1%.yml" set {_ilosc} to yaml value "ilosc" from file {_f} set {_ilosc} to {_ilosc} parsed as integer set {_item} to yaml value "item" from file {_f} set {_item} to {_item} parsed as item set {_nazwa} to yaml value "nazwa" from file {_f} add {_ilosc} of {_item} named "%{_nazwa}%" to player's inventory delete file {_f} send "%{ah.prefix}% &aOdebrano item!" on join: loop dir "plugins\Aukcje\database"'s files: set {_czas} to yaml value "czas" from file loop-value set {_czas} to {_czas} parsed as date set {_gracz} to yaml value "gracz" from file loop-value set {_x} to 0 if {_gracz} is "%player%": if now is less than {_czas}: add 1 to {_x} if {_x} > 0: send "%{ah.prefix}% &aMasz przedawnione itemy pod &7/przedawnione"