Skocz do zawartości

Rekomendowane odpowiedzi

Item Rarity System
/w Item glowing
/w Item Display name


Chcesz, aby twoje przedmioty posiadały jakąś narzuconą wartość?
Ze skryptem Item rarity system możesz to osiągnąć!

⭐TOTENGIF.gif.f3b5cbeb5d313311662bb0b9c2ab6a85.gif⭐

Jak wgrać:
Pobierz skrypt z tego linku. LINK
Stwórz nowy plik .sk w folderze scripts
Wklej do nowo stworzonego pliku całą zawartość z linku
Zrestartuj serwer.


Wymagania:
Skript 2.6 - *Download*
Skquery - *Download*
MorkazSk - *Download*
skript-yaml - *Download* 
GlowAPI - *Download*
PacketListenerApi - *Download*

 

Funkcje:
● Ustawienie własnych nazw wartości

Spoiler

image.png.9a801082a0afb59114da0751d3818ffc.png
image.png.1fe7aeb86ac0a24a88cfbfae2ffe2a9e.png

● Możliwość nadania glowingu dla przedmiotu leżącego na ziemi

Spoiler

image.png.990fbe9ba400641d5b134cef15811e20.png
image.png.484f6e27061457af9b1aca77faadd18a.png

● Możliwość nadania widocznej nazwy dla przedmiotu

Spoiler

image.png.2bfeeb2a79c1e42b3bce8340d0fe7822.png
image.png.07e5e69d31c9a66cccfeccc2867f2487.png

● Plik konfiguracyjny do ustalenia rzadkości danego przedmiotu

Spoiler

image.png.9cabb90a8bee9ac07d55d675ec35cc44.png
image.png.0c9bb1de541e3830799ae63a21edb375.png 

● Możliwość ustawienia Aliasów 

Spoiler

image.png.5d84ead7c13973075332024bcea45a90.png
image.png.10fb90b96470bbcda6baa9abeb8ea0b7.png

● Możliwość ustawienia integracji ze skrzynkami

Spoiler

Kq8XOGI.png
image.png.2fb6a717dbe49c6e42f4dfcde8271675.png

● Rozwinięty config. Ustawisz, jak chcesz!

Spoiler

image.png.f089bb450ab4cb0e46e9f0eb6794d4d5.png

● Możliwość debugowania skryptu w przypadku błędów

Spoiler

image.png.d1f284ec46517247aeeafb1e3a4325ad.png

● Możliwość ustawienia domyślnej ścieżki plików ItemRarity.yml oraz ItemNameAliases.yml

Spoiler

image.png.0a6d6c5e24a5f857c1fc3399dbfed37e.png

● Automatyczne wyłączenie skryptu w przypadku braku któregoś dodatku
● Automatyczne przypomnienie odnośnie pojawienia się nowej wersji

 

Do zrobienia:
- Tymczasowy brak pomysłów -
- Pomysły możecie pisać na dole -

 

Changelog:

Wypuszczenie wersji (v1.0)
 

Download w code.skript.pl:

Download dla osób niezalogowanych (Rozwiń spoiler):

Spoiler
#
#    ░██╗████████╗███████╗███╗░░░███╗░    ░██████╗░░█████╗░██████╗░██╗████████╗██╗░░░██╗░
#    ░██║╚══██╔══╝██╔════╝████╗░████║░    ░██╔══██╗██╔══██╗██╔══██╗██║╚══██╔══╝╚██╗░██╔╝░
#    ░██║░░░██║░░░█████╗░░██╔████╔██║░    ░██████╔╝███████║██████╔╝██║░░░██║░░░░╚████╔╝░░
#    ░██║░░░██║░░░██╔══╝░░██║╚██╔╝██║░    ░██╔══██╗██╔══██║██╔══██╗██║░░░██║░░░░░╚██╔╝░░░
#    ░██║░░░██║░░░███████╗██║░╚═╝░██║░    ░██║░░██║██║░░██║██║░░██║██║░░░██║░░░░░░██║░░░░
#    ░╚═╝░░░╚═╝░░░╚══════╝╚═╝░░░░░╚═╝░    ░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░░╚═╝░░░░░░╚═╝░░░░
#
#                ░░██████╗██╗░░░██╗░██████╗████████╗███████╗███╗░░░███╗░
#                ░██╔════╝╚██╗░██╔╝██╔════╝╚══██╔══╝██╔════╝████╗░████║░
#                ░╚█████╗░░╚████╔╝░╚█████╗░░░░██║░░░█████╗░░██╔████╔██║░
#                ░░╚═══██╗░░╚██╔╝░░░╚═══██╗░░░██║░░░██╔══╝░░██║╚██╔╝██║░
#                ░██████╔╝░░░██║░░░██████╔╝░░░██║░░░███████╗██║░╚═╝░██║░
#                ░╚═════╝░░░░╚═╝░░░╚═════╝░░░░╚═╝░░░╚══════╝╚═╝░░░░░╚═╝░
#
# Wymagania:
#  ● Skript 2.6
#  ● Skquery
#  ● MorkazSk
#  ● skript-yaml
#  ● GlowAPI
#  ● PacketListenerApi
#

options:
    version: 1.0
    author: PolsatGraniePL
#========================================================
#                        CONFIG
#========================================================

#  Wyświetla potrzebne informacje w celu naprawy błędów
    debug-mode: false
#  Czy item ma się świecić jak na screenie: https://imgur.com/a/lrzvIGI
    item-glow-system: true
#  Czy item na posiadać nad sobą nazwę z ilością oraz nazwą tak jak na screenie: https://imgur.com/a/bJ1mYP7
#  (Jeżeli angielska nazwa nie pasuje możesz zmienić ją w pliku ItemNameAliases.yml)
    item-display-name-system: true
#  Czy po otwarciu nienazwanej skrzynki itemy mają zostać zamienione na itemy z rzadkością?
#  screen: https://imgur.com/a/zdqfW2e
    item-name-on-chest-open: true

#  Określ lokalizację pliku ItemRarity.yml oraz ItemNameAliases.yml
    ItemRarity-file-location: plugins/Skript/


#========================================================
on script load:
    delete {ItemRarityType::*}
    delete {ItemRarityDisable}
    if "{@version}" is not text from "https://code.skript.pl/1BeeVrCe/raw":
        IRSkriptWarnMessage("&7[&6Skript&7] &rSkrypt &6%script%.sk&r ma dostępną nową wersje! &8(&rAktualna: &6{@version}&r, nowa: &6%text from "https://code.skript.pl/1BeeVrCe/raw"%&8)")
    else:
        IRSkriptWarnMessage("&7[&6Skript&7] &rSkrypt &6%script%.sk&r jest aktualny!")
    if plugins "SkQuery" or "MorkazSk" or "skript-yaml" or "GlowAPI" or "PacketListenerApi" is not enabled:
        IRSkriptWarnMessage("&7[&6Skript&7] &cSkrypt &6%script%.sk&c został wyłączony i nie będzie działać przez brakujące pluginy!")
        IRSkriptWarnMessage("         &7Brakujące pluginy:")
        if plugin "SkQuery" is not enabled:
            IRSkriptWarnMessage("         &8● &rSkQuery <url:https://www.spigotmc.org/resources/skquery-1-13-1-18.36631/>&8(&7click to download&8)")
        if plugin "MorkazSk" is not enabled:
            IRSkriptWarnMessage("         &8● &rMorkazSk <url:https://github.com/MorkaZ/MorkazSk/releases/tag/1.2>&8(&7click to download&8)")
        if plugin "skript-yaml" is not enabled:
            IRSkriptWarnMessage("         &8● &rskript-yaml <url:https://github.com/Sashie/skript-yaml/releases/tag/v1.4>&8(&7click to download&8)")
        if plugin "GlowAPI" is not enabled:
            IRSkriptWarnMessage("         &8● &rGlowAPI <url:https://www.spigotmc.org/resources/api-glowapi.19422/>&8(&7click to download&8)")
        if plugin "PacketListenerApi" is not enabled:
            IRSkriptWarnMessage("         &8● &rPacketListenerApi <url:https://www.spigotmc.org/resources/api-packetlistenerapi.2930/>&8(&7click to download&8)")
        set {ItemRarityDisable} to true
        stop
#========================================================
#                       CONFIG V2  
#========================================================
#           
#           
#
#Dostępne kolory:
#    BLACK, DARK_BLUE, DARK_GREEN, DARK_AQUA, DARK_RED, DARK_PURPLE, GOLD, GRAY, DARK_GRAY, BLUE, GREEN, AQUA, RED, PURPLE, YELLOW, WHITE
#     &0       &1         &4          &3        &4         &5        &6    &7       &8      &9     &a    &b    &c    &d      &e     &f
#
#      W celu ododania nowej lini tak jak na tym screenshocie: https://imgur.com/a/PAd4zNM
#      zamień np. "&7&lCOMMON" na "%nl%&7&lCOMMON" z dopiskiem %nl% w celu utworzenia nowej linijki

#      Nazwa rzadkości
    set {ItemRarityType::common} to "&7&lPOSPOLITY"
#      Kolor podświetlania rzadkości podczas wyrzucenia
    set {ItemRarityType::common-color} to "GRAY"
#      Kolor nazwy itemu podczas wyrzucenia
    set {ItemRarityType::common-name} to "&7"
    
    set {ItemRarityType::uncommon} to "&a&lNIEPOSPOLITY"
    set {ItemRarityType::uncommon-color} to "GREEN"
    set {ItemRarityType::uncommon-name} to "&a"
    set {ItemRarityType::rare} to "&9&lRZADKI"
    set {ItemRarityType::rare-color} to "BLUE"
    set {ItemRarityType::rare-name} to "&9"
    set {ItemRarityType::epic} to "&5&lEPICKI"
    set {ItemRarityType::epic-color} to "DARK_PURPLE"
    set {ItemRarityType::epic-name} to "&5&l"
    set {ItemRarityType::legendary} to "&6&lLEGENDARNY"
    set {ItemRarityType::legendary-color} to "GOLD"
    set {ItemRarityType::legendary-name} to "&6&l"
    set {ItemRarityType::mythic} to "&c&lMITYCZNY"
    set {ItemRarityType::mythic-color} to "RED"
    set {ItemRarityType::mythic-name} to "&c&l"

#========================================================    
#  Pobieranie listy itemów z wersji 1.18.1
    set {_DefaultMaterialsList::*} to text from "https://code.skript.pl/LhqC4svp/raw" split at " ,"
    set {ItemRarityTypeList::*} to "common", "uncommon", "rare", "epic", "legendary" and "mythic"
    set {ItemRarityTypeInventory::*} to "Chest", "Large Chest", "Furnace", "Item Hopper", "Ender Chest", "Shulker Box", "Barrel", "Smoker", "Blast Furnace", "Dispenser", "Dropper" and "Minecart with Chest"
    set {ItemRarityNameType::*} to {ItemRarityType::common}, {ItemRarityType::uncommon}, {ItemRarityType::rare}, {ItemRarityType::epic}, {ItemRarityType::legendary} and {ItemRarityType::mythic}
    load yaml "{@ItemRarity-file-location}ItemRarity.yml" as "{@ItemRarity-file-location}ItemRarity.yml"
    load yaml "{@ItemRarity-file-location}ItemNameAliases.yml" as "{@ItemRarity-file-location}ItemNameAliases.yml"
    if yaml path "aliases" from "{@ItemRarity-file-location}ItemNameAliases.yml" doesn't have value:
        set yaml value "aliases.sponge" from "{@ItemRarity-file-location}ItemNameAliases.yml" to "gąbka"
        set yaml value "aliases.stone block" from "{@ItemRarity-file-location}ItemNameAliases.yml" to "kamień"
        set yaml value "aliases.grass block" from "{@ItemRarity-file-location}ItemNameAliases.yml" to "blok trawy"
        save yaml "{@ItemRarity-file-location}ItemNameAliases.yml"
    if yaml path "common" from "{@ItemRarity-file-location}ItemRarity.yml" doesn't have value:
        set yaml list "common" from "{@ItemRarity-file-location}ItemRarity.yml" to {_DefaultMaterialsList::*}
        set yaml list "uncommon" from "{@ItemRarity-file-location}ItemRarity.yml" to ""
        set yaml list "rare" from "{@ItemRarity-file-location}ItemRarity.yml" to ""
        set yaml list "epic" from "{@ItemRarity-file-location}ItemRarity.yml" to ""
        set yaml list "legendary" from "{@ItemRarity-file-location}ItemRarity.yml" to ""
        set yaml list "mythic" from "{@ItemRarity-file-location}ItemRarity.yml" to ""
        save yaml "{@ItemRarity-file-location}ItemRarity.yml"
        IRSkriptWarnMessage("&7[&6Skript&7] &rWgrano &6default&r config do skryptu &6%script%.sk&r.")
    loop {ItemRarityTypeList::*}:
        IRreloadConfig("%loop-value%")
    IRSkriptWarnMessage("&7[&6Skript&7] &rPoprawnie załadowano wszystkie itemy w skrypcie &6%script%.sk&r.")
        
#========================================================
    
function IRSkriptWarnMessage(tekst: text):
    send formatted "%{_tekst}%" to all ops
    send "%{_tekst}%" to console

function IRreloadConfig(typ: text):
    set {_} to yaml value "%{_typ}%" from "{@ItemRarity-file-location}ItemRarity.yml"
    set {_X} to "%{_}%"
    replace all "[" and "]" with "" in {_X}
    set {ItemRarity::%{_typ}%::*} to "%{_X}%" split at ", "
    
function IRreloadEQ(gracz: player):
    loop all items in {_gracz}'s inventory:
        delete {_jest}
        loop lore of loop-item:
            if {ItemRarityNameType::*} contains loop-value-2:
                set {_jest} to true
        {_jest} is not set
        loop {ItemRarityTypeList::*}:
            if {ItemRarity::%loop-value-2%::*} contains "%type of loop-item%":
                add "%{ItemRarityType::%loop-value-2%}%" to lore of loop-item
        {@debug-mode} is true    
        broadcast "&8(&cIRreloadEQ - function plr inv&8) &r%{_gracz}%: %type of loop-item%"
            
function IRreloadEQchest(gracz: player):
    loop all items in {_gracz}'s current inventory:
        delete {_jest}
        loop lore of loop-item:
            if {ItemRarityNameType::*} contains loop-value-2:
                set {_jest} to true
        {_jest} is not set
        loop {ItemRarityTypeList::*}:
            if {ItemRarity::%loop-value-2%::*} contains "%type of loop-item%":
                add "%{ItemRarityType::%loop-value-2%}%" to lore of loop-item
        {@debug-mode} is true    
        broadcast "&8(&cIRreloadEQchest - function cr inv&8) &r%{_gracz}%: %type of loop-item%"

on item merge:
    {ItemRarityDisable} is not set
    {@item-display-name-system} is true
    set {_z} to 10 first characters of uncolored "%future event-entity%" in lowercase
    replace all "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "r", "s", "t", "u", "w", "y", "z", "x", "v", "q", "'" and " " with "" in {_z}
    if "%{_z}%" is "":
        set {_z} to "1"
    loop {ItemRarityTypeList::*}:
        if {ItemRarity::%loop-value%::*} contains "%type of event-item%":
            if name of event-item is set:
                set display name of future event-entity to "&8(&7%item amount of event-item + {_z} parsed as number%&8)%{ItemRarityType::%loop-value%-name}% %name of event-item%" in proper case
            else:
                set {_2} to yaml value "aliases.%type of event-item%" from "{@ItemRarity-file-location}ItemNameAliases.yml"
                if {_2} is set:
                    set display name of future event-entity to "&8(&7%item amount of event-item + {_z} parsed as number%&8)%{ItemRarityType::%loop-value%-name}% %{_2}%" in proper case
                else:
                    set display name of future event-entity to "&8(&7%item amount of event-item + {_z} parsed as number%&8)%{ItemRarityType::%loop-value%-name}% %type of event-item%" in proper case
on item spawn:
    {ItemRarityDisable} is not set
    {@item-display-name-system} is true
    loop {ItemRarityTypeList::*}:
        if {ItemRarity::%loop-value%::*} contains "%type of event-item%":
            if name of event-item is set:
                set display name of event-entity to "&8(&7%item amount of event-item%&8)%{ItemRarityType::%loop-value%-name}% %name of event-item%" in proper case
            else:
                set {_} to yaml value "aliases.%type of event-item%" from "{@ItemRarity-file-location}ItemNameAliases.yml"
                if {_} is set:
                    set display name of event-entity to "&8(&7%item amount of event-item%&8)%{ItemRarityType::%loop-value%-name}% %{_}%" in proper case
                else:
                    set display name of event-entity to "&8(&7%item amount of event-item%&8)%{ItemRarityType::%loop-value%-name}% %type of event-item%" in proper case
on item spawn:
    {ItemRarityDisable} is not set
    wait 1 tick
    if "%lore of event-item%" is "<none>":
        set {_l} to ""
    else:
        set {_l} to "%lore of event-item%"
    set {_t} to type of event-item
    set {_a} to item amount of event-item
    loop {ItemRarityTypeList::*}:
        {@item-glow-system} is true
        if {ItemRarity::%loop-value%::*} contains "%type of event-item%":
            make event-entity glow with color "%{ItemRarityType::%loop-value%-color}%" for all players
    loop lore of event-item:
        if {ItemRarityNameType::*} contains loop-value:
            stop
    delete event-entity
    loop {ItemRarityTypeList::*}:
        if {ItemRarity::%loop-value%::*} contains "%type of event-item%":
            drop {_a} of {_t} with lore "%{_l}%%{ItemRarityType::%loop-value%}%" at event-location
            stop
    broadcast "&7[&6Skript&7] &c&lNieznany item!%nl%      &r""&6%type of event-item%&r"", dodaj go do listy itemów w &6{@ItemRarity-file-location}ItemRarity.yml &7(&6%script%.sk&7)"
    loop all players in radius 2 around event-entity:
        give event-item to loop-player
        stop
    {@debug-mode} is true
    broadcast "&8(&cOn spawn item - event&8) &r%{_t}%"

on inventory click:
    {ItemRarityDisable} is not set
    wait 1 tick
    IRreloadEQ(player)
    
on inventory open:
    {ItemRarityDisable} is not set
    {@item-name-on-chest-open} is true
    wait 1 tick
    {ItemRarityTypeInventory::*} contains name of player's current inventory
    IRreloadEQchest(player)
    

 

 

 

Edytowane przez polsatgraniepl
Odnośnik do komentarza
https://skript.pl/temat/52198-item-rarity-system-czyli-ustalanie-warto%C5%9Bci-danego-itemu/
Udostępnij na innych stronach

Dołącz do dyskusji

Możesz dodać zawartość już teraz a zarejestrować się później. Jeśli posiadasz już konto, zaloguj się aby dodać zawartość za jego pomocą.

Nieaktywny
Dodaj odpowiedź do tematu...

×   Wklejono zawartość z formatowaniem.   Usuń formatowanie

  Dozwolonych jest tylko 75 emoji.

×   Odnośnik został automatycznie osadzony.   Przywróć wyświetlanie jako odnośnik

×   Przywrócono poprzednią zawartość.   Wyczyść edytor

×   Nie możesz bezpośrednio wkleić grafiki. Dodaj lub załącz grafiki z adresu URL.

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...