Files
god-items.sk
Code
1 168
god-items.sk
options:
prefix: &8[&bGodItems&8]&r
gui-title: &8God Items
function godSword() :: item:
set {_item} to unbreakable netherite sword
set name of {_item} to "&cGod Miecz"
enchant {_item} with sharpness 6
enchant {_item} with fire aspect 2
enchant {_item} with looting 4
return {_item}
function godPickaxe() :: item:
set {_item} to unbreakable netherite pickaxe
set name of {_item} to "&bGod Kilof"
enchant {_item} with efficiency 6
enchant {_item} with fortune 4
return {_item}
function godAxe() :: item:
set {_item} to unbreakable netherite axe
set name of {_item} to "&6God Siekiera"
enchant {_item} with efficiency 6
enchant {_item} with fortune 3
enchant {_item} with sharpness 5
return {_item}
function godMace() :: item:
set {_item} to unbreakable mace
set name of {_item} to "&5God Mace"
enchant {_item} with density 6
enchant {_item} with breach 5
enchant {_item} with wind burst 3
return {_item}
function godSpear() :: item:
set {_item} to unbreakable netherite spear
set name of {_item} to "&eGod Włócznia"
enchant {_item} with lunge 4
enchant {_item} with sharpness 5
enchant {_item} with fire aspect 2
return {_item}
function godChopLogs(loc: location, owner: player):
loop blocks in radius 1 around {_loc}:
if "%type of loop-block%" contains "log":
set {_key} to "%world of loop-block%:%x-coordinate of loop-block%:%y-coordinate of loop-block%:%z-coordinate of loop-block%"
if {god::tree::visited::%uuid of {_owner}%::%{_key}%} is not set:
set {god::tree::visited::%uuid of {_owner}%::%{_key}%} to true
break loop-block naturally
godChopLogs(location of loop-block, {_owner})
command /daj-god-item <text>:
permission: goditems.admin
permission message: "{@prefix} &cNie masz uprawnień."
trigger:
if player is not set:
send "{@prefix} &cTej komendy może użyć tylko gracz."
stop
if arg-1 is "*":
set {god::gui::target::%uuid of player%} to "*"
else:
set {_target} to arg-1 parsed as player
if {_target} is not set:
send "{@prefix} &cPodaj nick gracza online albo *."
stop
set {god::gui::target::%uuid of player%} to {_target}
set {_gui} to chest inventory with 1 row named "{@gui-title}"
set slot 1 of {_gui} to godSword()
set slot 3 of {_gui} to godPickaxe()
set slot 4 of {_gui} to godAxe()
set slot 5 of {_gui} to godMace()
set slot 7 of {_gui} to godSpear()
open {_gui} to player
on inventory click:
if name of event-inventory is "{@gui-title}":
cancel event
if clicked inventory is player's inventory:
stop
if index of event-slot is 1:
set {_item} to godSword()
else if index of event-slot is 3:
set {_item} to godPickaxe()
else if index of event-slot is 4:
set {_item} to godAxe()
else if index of event-slot is 5:
set {_item} to godMace()
else if index of event-slot is 7:
set {_item} to godSpear()
else:
stop
if {god::gui::target::%uuid of player%} is not set:
stop
if {god::gui::target::%uuid of player%} is "*":
loop all players:
give {_item} to loop-player
send "{@prefix} &aPrzedmiot otrzymali wszyscy gracze online."
else:
set {_target} to {god::gui::target::%uuid of player%}
if {_target} is online:
give {_item} to {_target}
send "{@prefix} &aPrzekazano przedmiot graczowi &e%name of {_target}%&a."
else:
send "{@prefix} &cTen gracz jest już offline."
on inventory close:
if name of event-inventory is "{@gui-title}":
delete {god::gui::target::%uuid of player%}
on right click:
if name of player's tool is "&cGod Miecz":
if {god::cooldown::dash::%uuid of player%} is set:
if difference between now and {god::cooldown::dash::%uuid of player%} is less than 30 seconds:
send "{@prefix} &cDash jest jeszcze na cooldownie."
stop
set {god::cooldown::dash::%uuid of player%} to now
push player in direction of player at speed 1.8
send "{@prefix} &aUżyto dasha!"
else if name of player's tool is "&5God Mace":
if {god::cooldown::heal::%uuid of player%} is set:
if difference between now and {god::cooldown::heal::%uuid of player%} is less than 2 minutes:
send "{@prefix} &cLeczenie jest jeszcze na cooldownie."
stop
set {god::cooldown::heal::%uuid of player%} to now
heal player
send "{@prefix} &aTwoje zdrowie zostało uzupełnione."
on damage of player:
if attacker is a player:
if name of attacker's tool is "&5God Mace":
strike lightning effect at location of victim
damage victim by 2
else if name of attacker's tool is "&eGod Włócznia":
apply slowness 255 to victim for 1.5 seconds
on break:
if player's tool is netherite pickaxe:
if name of player's tool is "&bGod Kilof":
if {god::tunnel::%uuid of player%} is set:
stop
set {god::tunnel::%uuid of player%} to true
loop blocks in radius 1.5 around event-block:
if loop-block is not event-block:
if yaw of player is between -45 and 45 or yaw of player is between 135 and 180 or yaw of player is between -180 and -135:
if z-coordinate of loop-block is z-coordinate of event-block:
break loop-block naturally
else:
if x-coordinate of loop-block is x-coordinate of event-block:
break loop-block naturally
delete {god::tunnel::%uuid of player%}
if name of player's tool is "&6God Siekiera":
if "%type of event-block%" contains "log":
if {god::tree::active::%uuid of player%} is set:
stop
set {god::tree::active::%uuid of player%} to true
delete {god::tree::visited::%uuid of player%::*}
godChopLogs(location of event-block, player)
delete {god::tree::visited::%uuid of player%::*}
delete {god::tree::active::%uuid of player%}