Files
boss-system.sk
custom-items.sk
custom-skills.sk
Code
3 973
custom-items.sk
# Custom Items System
# Tworzenie i zarządzanie customowymi przedmiotami
# Version: 2.0
options:
prefix: &6[CustomItems]&r
admin-permission: customitems.admin
cooldown: 10 seconds
command /stwórzcustomufke [<text>] [<text>] [<text>] [<text>]:
permission: {@admin-permission}
aliases: /customitem, /ci
trigger:
set {_a1} to arg-1
set {_a2} to arg-2
set {_a3} to arg-3
set {_a4} to arg-4
if {_a1} is set:
set {_lastuse} to {customitems::cooldown::%player%}
if {_lastuse} is set:
set {_timeleft} to difference between {_lastuse} and now
if {_timeleft} is less than {@cooldown}:
set {_remaining} to {@cooldown} - {_timeleft}
send "{@prefix} &cMusisz poczekać jeszcze &e%{_remaining}% &caby użyć tej komendy!"
stop
if {_a1} is not set:
send ""
send "{@prefix} &eSystem Customowych Itemów"
send "&7/stwórzcustomufke create <id> &8- &fTworzy nowy item"
send "&7/stwórzcustomufke give <id> [gracz] &8- &fDaje customowy item"
send "&7/stwórzcustomufke list &8- &fLista customowych itemów"
send "&7/stwórzcustomufke delete <id> &8- &fUsuwa customowy item"
send "&7/stwórzcustomufke edit <id> &8- &fEdytuje customowy item"
send "&7/stwórzcustomufke setcooldown <id> <czas> &8- &fUstawia cooldown itemu"
send "&7/stwórzcustomufke cooldown <id> &8- &fSprawdza cooldown itemu"
send "&7/stwórzcustomufke setnazwa <id> <nazwa> &8- &fUstawia nazwę itemu"
send "&7/stwórzcustomufke addskill <id> <skill> &8- &fDodaje umiejętność do itemu"
send "&7/stwórzcustomufke removeskill <id> <skill> &8- &fUsuwa umiejętność z itemu"
send "&7/stwórzcustomufke listskills <id> &8- &fLista umiejętności itemu"
send "&7/stwórzcustomufke info <id> &8- &fInformacje o itemie"
send ""
stop
if {_a1} is "create":
if {_a2} is not set:
send "{@prefix} &cPodaj ID itemu! &7/stwórzcustomufke create <id>"
stop
if {customitems::%{_a2}%::exists} is true:
send "{@prefix} &cItem o ID &e%{_a2}%&c już istnieje!"
stop
set {_item} to player's tool
if {_item} is air:
send "{@prefix} &cMusisz trzymać item w ręce!"
stop
set {customitems::%{_a2}%::item} to {_item}
set {customitems::%{_a2}%::exists} to true
set {customitems::%{_a2}%::creator} to player
set {customitems::%{_a2}%::created} to now
add {_a2} to {customitems::list::*}
set {customitems::cooldown::%player%} to now
send "{@prefix} &aPomyślnie utworzono customowy item: &e%{_a2}%"
send "{@prefix} &7Item: &f%name of {_item}%"
stop
if {_a1} is "give":
if {_a2} is not set:
send "{@prefix} &cPodaj ID itemu! &7/stwórzcustomufke give <id> [gracz]"
stop
if {customitems::%{_a2}%::exists} is not true:
send "{@prefix} &cItem o ID &e%{_a2}%&c nie istnieje!"
stop
set {_target} to player
if {_a3} is set:
set {_target} to {_a3} parsed as offline player
if {_target} is not set:
send "{@prefix} &cGracz &e%{_a3}%&c nie istnieje!"
stop
give {customitems::%{_a2}%::item} to {_target}
set {customitems::cooldown::%player%} to now
send "{@prefix} &aWydano customowy item &e%{_a2}%&a dla &e%{_target}%" to player
if {_target} is not player:
send "{@prefix} &aOtrzymałeś customowy item: &e%{_a2}%" to {_target}
stop
if {_a1} is "list":
if size of {customitems::list::*} is 0:
send "{@prefix} &cBrak customowych itemów!"
stop
send ""
send "{@prefix} &eLista Customowych Itemów &7(%size of {customitems::list::*}%)"
send ""
loop {customitems::list::*}:
set {_itemname} to name of {customitems::%loop-value%::item}
if {_itemname} is not set:
set {_itemname} to "%type of {customitems::%loop-value%::item}%"
set {_cd} to {customitems::%loop-value%::itemcooldown}
set {_customname} to {customitems::%loop-value%::customname}
set {_skillcount} to size of {customitems::%loop-value%::skills::*}
set {_info} to "&8• &e%loop-value% &8- &f%{_itemname}% &7(by %{customitems::%loop-value%::creator}%)"
if {_customname} is set:
set {_info} to "%{_info}% &8| &bNazwa: &3%{_customname}%"
if {_cd} is set:
set {_info} to "%{_info}% &8| &eCooldown: &6%{_cd}%"
if {_skillcount} > 0:
set {_info} to "%{_info}% &8| &dUmiejętności: &5%{_skillcount}%"
send {_info}
send ""
stop
if {_a1} is "delete":
if {_a2} is not set:
send "{@prefix} &cPodaj ID itemu! &7/stwórzcustomufke delete <id>"
stop
if {customitems::%{_a2}%::exists} is not true:
send "{@prefix} &cItem o ID &e%{_a2}%&c nie istnieje!"
stop
delete {customitems::%{_a2}%::*}
remove {_a2} from {customitems::list::*}
set {customitems::cooldown::%player%} to now
send "{@prefix} &aUsunięto customowy item: &e%{_a2}%"
stop
if {_a1} is "edit":
if {_a2} is not set:
send "{@prefix} &cPodaj ID itemu! &7/stwórzcustomufke edit <id>"
stop
if {customitems::%{_a2}%::exists} is not true:
send "{@prefix} &cItem o ID &e%{_a2}%&c nie istnieje!"
stop
set {_item} to player's tool
if {_item} is air:
send "{@prefix} &cMusisz trzymać item w ręce!"
stop
set {customitems::%{_a2}%::item} to {_item}
set {customitems::%{_a2}%::modified} to now
set {customitems::%{_a2}%::modifier} to player
set {customitems::cooldown::%player%} to now
send "{@prefix} &aZaktualizowano customowy item: &e%{_a2}%"
send "{@prefix} &7Nowy item: &f%name of {_item}%"
stop
if {_a1} is "setcooldown":
if {_a2} is not set:
send "{@prefix} &cPodaj ID itemu! &7/stwórzcustomufke setcooldown <id> <czas>"
stop
if {customitems::%{_a2}%::exists} is not true:
send "{@prefix} &cItem o ID &e%{_a2}%&c nie istnieje!"
stop
if {_a3} is not set:
send "{@prefix} &cPodaj czas cooldownu! &7Przykład: 5 seconds, 1 minute, 30 seconds"
stop
set {customitems::%{_a2}%::itemcooldown} to {_a3}
set {customitems::cooldown::%player%} to now
send "{@prefix} &aUstawiono cooldown dla itemu &e%{_a2}%&a na: &6%{_a3}%"
stop
if {_a1} is "cooldown":
if {_a2} is not set:
send "{@prefix} &cPodaj ID itemu! &7/stwórzcustomufke cooldown <id>"
stop
if {customitems::%{_a2}%::exists} is not true:
send "{@prefix} &cItem o ID &e%{_a2}%&c nie istnieje!"
stop
set {_cd} to {customitems::%{_a2}%::itemcooldown}
if {_cd} is set:
send "{@prefix} &eCooldown dla itemu &6%{_a2}%&e: &6%{_cd}%"
else:
send "{@prefix} &eItem &6%{_a2}%&e nie ma ustawionego cooldownu"
stop
if {_a1} is "setnazwa":
if {_a2} is not set:
send "{@prefix} &cPodaj ID itemu! &7/stwórzcustomufke setnazwa <id> <nazwa>"
stop
if {customitems::%{_a2}%::exists} is not true:
send "{@prefix} &cItem o ID &e%{_a2}%&c nie istnieje!"